<?php 
$show_validator = true;
include TMPL_PATH.'public/header.phtml';
?>
<script type="text/javascript">
<!--
$(function(){
	$.formValidator.initConfig({autotip:true,formid:"theForm",onerror:function(msg){}});
	$("#suppliers_name").formValidator({onshow:"请输入面料编号",onfocus:"面料编号应该为2-20位之间"}).inputValidator({min:2,max:20,onerror:"供货商名称应该为2-20位之间"}).ajaxValidator({
		type : "get",
		url : "<?php echo U('suppliers/suppliers_checkname_ajx', array('sid' => isset($supplierInfo) ? $supplierInfo['suppliers_id'] : null));?>",
		data :"",
		datatype : "html",
		async:'false',
		success : function(data){	
            if( data == "1" )
			{
                return true;
			}
            else
			{
                return false;
			}
		},
		buttons: $("#dosubmit"),
		onerror : "供货商名称已存在。",
		onwait : "请稍候..."
		});
})
//-->
</script>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='<?php echo U('suppliers/suppliers_list');?>'><em>供应商列表</em></a><span>|</span>
        <a href='javascript:;' class="on" ><em><?php if(isset($supplierInfo)):?>编辑<?php else:?>添加<?php endif;?>供应商</em></a>
    </div>
</div>
<div class="pad_10">
<div class="common-form">
<form name="theForm" action="__SELF__" method="post" id="theForm">
<div id="price-div">
<table width="100%" cellspacing="1" cellpadding="3"  class="table_form contentWrap">
  <tbody>
  <tr>
    <th width="200" class="label">面料编号：</th>
    <td><input type="text" class="input-text" value="<?php echo isset($supplierInfo) ? $supplierInfo['suppliers_name'] : null;?>" maxlength="60" id="suppliers_name" name="suppliers_name"><span class="require-field">*</span></td>
  </tr>
    <tr>
    <th width="200" class="label">面料名称：</th>
    <td><input type="text" class="input-text" value="<?php echo isset($supplierInfo) ? $supplierInfo['lining_name'] : null;?>" maxlength="60" id="lining_name" name="lining_name"><span class="require-field">*</span></td>
  </tr>
  <tr>
      <th width="200" class="label">品牌名称：</th>
      <td><input type="text" class="input-text" value="<?php echo isset($supplierInfo) ? $supplierInfo['brand'] : null;?>" maxlength="60" id="brand" name="brand"><span class="require-field">*</span></td>
  </tr>
    <tr>
    <th width="200" class="label">幅宽：</th>
    <td><input type="text" class="input-text" value="<?php echo isset($supplierInfo) ? $supplierInfo['breadth'] : null;?>" maxlength="60" id="breadth" name="breadth"><span class="require-field">*</span></td>
  </tr>
    <tr>
    <th width="200" class="label">耗料：</th>
    <td><input type="text" class="input-text" value="<?php echo isset($supplierInfo) ? $supplierInfo['material'] : null;?>" maxlength="60" id="material" name="material"><span class="require-field">*</span></td>
  </tr>
    <tr>
    <th width="200" class="label">衬衫订扣线：</th>
    <td><input type="text" class="input-text" value="<?php echo isset($supplierInfo) ? $supplierInfo['shirt_line'] : null;?>" maxlength="60" id="shirt_line" name="shirt_line"><span class="require-field">*</span></td>
  </tr>
    <tr>
    <th class="label">是否半麻衬：</th>
    <td><input type="radio" name="is_lined" value="1" <?php echo (isset($supplierInfo) && $supplierInfo['is_lined']==1) ? 'checked' : null;?>> 是 <input type="radio" name="is_lined" value="0" <?php echo isset($supplierInfo) && $supplierInfo['is_lined']==0 ? 'checked' : null;?>> 否</td>
  </tr>
  <tr>
    <th class="label">纹路：</th>
    <td>
        <select name="figure" >
        <option value="0">净色</option>
        <option value="1" <?php if($supplierInfo['figure'] == '1'){echo 'selected';}?>>格子</option>
        <option value="2" <?php if($supplierInfo['figure'] == '2'){echo 'selected';}?>>条纹</option>
        </select>
    </td>
  </tr>
  <tr>
      <th class="label">面料类型：</th>
      <td>
          <select name="suppliers_type" >
              <option value="1" <?php if($supplierInfo['suppliers_type'] == '1' || $suppliers_type=='1'){echo 'selected';}?>>西装</option>
              <option value="2" <?php if($supplierInfo['suppliers_type'] == '2' || $suppliers_type=='2'){echo 'selected';}?>>衬衫</option>
          </select>
      </td>
  </tr>
  <tr>
      <th width="200" class="label">纹理：</th>
      <td><input type="text" class="input-text" value="<?php echo isset($supplierInfo) ? $supplierInfo['grooves'] : "" ;?>" maxlength="60" id="material" name="grooves"></td>
  </tr>
  <tr>
      <th width="200" class="label">管理员：</th>
      <td><input type="text" class="input-text" value="<?php echo isset($supplierInfo) ? $supplierInfo['admin'] : "" ;?>" maxlength="60" id="material" name="admin"></td>
  </tr>
  <tr>
    <th class="label">供货商描述：</th>
    <td><textarea rows="4" cols="60" name="suppliers_desc"><?php echo isset($supplierInfo) ? $supplierInfo['suppliers_desc'] : null;?></textarea></td>
  </tr>
  <!--
  <tr>
    <th class="label">负责该供货商的管理员：</th>
    <td>      
    <?php 
    if(isset($adminList) && $adminList):
    	foreach ($adminList as $admin):
    ?>
    <input type="checkbox" value="<?php echo $admin['id']?>" name="admins[]" <?php if($admin['type'] == 'this'){echo 'checked';}?>>
      <?php echo $admin['username']?><?php if($admin['type'] == 'other'):?>(*)<?php endif;?>&nbsp;&nbsp;
    <?php 
    	endforeach;
    endif;
    ?>
    <br>
    <span id="noticeAdmins" style="display:block" class="notice-span">用星号(*)标注的管理员表示已经负责其他的供货商了</span></td>
  </tr>
  -->

   <tr>
    <th class="label">是否启用供货商：</th>
    <td><input type="radio" name="is_check" value="1" <?php echo (!isset($supplierInfo) || (isset($supplierInfo) && $supplierInfo['is_check']==1)) ? 'checked' : null;?>> 是 <input type="radio" name="is_check" value="0" <?php echo isset($supplierInfo) && $supplierInfo['is_check']==0 ? 'checked' : null;?>> 否</td>
  </tr>
  <tr>
    <th class="label">负责该供货商的管理员<br/>是否核心供货商：</th>
    <td><input type="radio" name="isspec" value="1" <?php echo ((isset($supplierInfo) && $supplierInfo['isspec']==1)) ? 'checked' : null;?>> 是 <input type="radio" name="isspec" value="0" <?php echo (!isset($supplierInfo) || isset($supplierInfo) && $supplierInfo['isspec']==0) ? 'checked' : null;?>> 否</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input name="dosubmit" type="submit" value="提交" class="button" id="dosubmit" />
    </td>
  </tr>
</tbody></table>
</div>
    <div class="bk15"></div>
</form>
</div>
</div>
</body>
</html>